<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02定义模块</title>
</head>
<body>
    <div ng-app="appDemo">
        <div ng-controller="demoController">
            <h1>{{name}}在{{school}}学习</h1>
            <ul>
                <li ng-repeat="(key,course) in courses">第{{key+1}}天学{{course}}</li>
            </ul>
        </div>
    </div>
    <script src="libs/angular.min.js"></script>
    <script>
        //定义模块
        var app = angular.module("appDemo",[]);
        //定义控制器，需要注入$scope，在这里就是指模型（module）
        app.controller("demoController",["$scope",function($scope){
            $scope.name="张三";
            $scope.school="河南工程学院";
            $scope.courses = ["数据结构","计算机组成原理","Linux"];
        }]);
    </script>
</body>
</html>